﻿<UserControl xmlns:Controls="clr-namespace:Flare.Controls" x:Class="Flare.Pages.Endpoint.Edit"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" d:DesignHeight="600" d:DesignWidth="800" xmlns:base="clr-namespace:Flare.DB" >

    <UserControl.Resources>
        <ObjectDataProvider x:Key="general_departmentsDataSet" ObjectType="{x:Type base:general_departments}" MethodName="Index" IsAsynchronous="False" />
        <ObjectDataProvider x:Key="general_roomsDataSet" ObjectType="{x:Type base:general_rooms}" MethodName="Index" IsAsynchronous="False">
            <ObjectDataProvider.MethodParameters>
                <x:Null/>
            </ObjectDataProvider.MethodParameters>
        </ObjectDataProvider>
        <ObjectDataProvider x:Key="endpoint_typesDataSet" ObjectType="{x:Type base:endpoint_types}" MethodName="Index" IsAsynchronous="False"/>
    </UserControl.Resources>

    <DockPanel DockPanel.LastChildFill="False" VerticalAlignment="Top">
        <Controls:FlameMenu x:Name="Department" Caption="Отдел" SelectedValuePath="id_department" DisplayMemberPath="department" DockPanel.Dock="Top" 
                            ItemsSource="{Binding Source={StaticResource general_departmentsDataSet}}" SelectionChanged="Department_SelectionChanged" 
                            SelectedValue="{Binding id_department, Mode=OneWay}"/>

        <Controls:FlameMenu x:Name="Room" Caption="Кабинет" SelectedValuePath="id_room" DisplayMemberPath="room" DockPanel.Dock="Top" 
                            ItemsSource="{Binding Source={StaticResource general_roomsDataSet}}" SelectedValue="{Binding id_room, Mode=OneWay}"/>

        <Controls:FlameMenu x:Name="netType" Caption="Тип" SelectedValuePath="id_type" ItemsSource="{Binding Source={StaticResource endpoint_typesDataSet}}" 
                            DockPanel.Dock="Top" DisplayMemberPath="type" SelectedValue="{Binding id_type, Mode=OneWay}"  />

        <Controls:FlameTbox x:Name="endpoint_name" Header="Наименование" DockPanel.Dock="Top" Margin="10,20,0,0" Width="577" Text="{Binding name}" />
        <Controls:FlameTbox x:Name="endpoint_ip" Header="IP адрес" DockPanel.Dock="Top" Margin="10,10,0,0" Width="373" Text="{Binding ip}" />
        <Controls:FlameTbox x:Name="endpoint_phone" Header="Телефон" DockPanel.Dock="Top" Margin="10,10,0,0" Width="373" Text="{Binding phone}"/>

        <Controls:FlameButtonInfo x:Name="saveButton" Content="Сохранить" Click="saveButton_Click" HorizontalAlignment="Left" DockPanel.Dock="Top" 
                                  Margin="10,40,0,0" />
    </DockPanel>
</UserControl>
